from django.urls import path, include
from rest_framework.routers import DefaultRouter

from apps.common.account.views import CompanyViewSet, LoginView, UserInfoView, AccountViewSet
from apps.pollution.views import CompanySelfAssessmentViewSet, FileTemViewSets, AnswerViewSet, UploadImageView
from apps.pollution.index.views import IndexViewSet

router = DefaultRouter()

# 首页
router.register('index', IndexViewSet, basename='index')

router.register('account', AccountViewSet, basename='account')
router.register('company', CompanyViewSet, basename='company')
router.register('company_self_assessment', CompanySelfAssessmentViewSet, basename='company_self_assessment')
router.register('file_template', FileTemViewSets, basename='file_template')
router.register('answer', AnswerViewSet, basename='answer')

urlpatterns = [
    path('login', LoginView.as_view()),
    path('user/info', UserInfoView.as_view()),
    path('api/', include(router.urls)),
    path('upload_image', UploadImageView.as_view()),

]
